﻿using NB.MGJ.Common;
using NB.MGJ.Common.API;
using NB.MGJ.Common.Utility;
using NB.MGJ.Log;
using NB.MGJ.Model;
using NB.MGJ.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Controllers;

namespace NB.MGJ.API
{
    //[ApiAuthorizeFilter]
    [ApiHandleErrorAttribute]
    public class ApiMGJTestController : ApiBaseController<LogOnUserModel>
    {

        #region GET,PUT,POST,DELETE

        //pass
        [Route("api/get/get")]
        [HttpGet]
        public IHttpActionResult DemoGet()
        {
            var rs1 = MD5Manager.Gen_MD5("123" + DateTime.Now.ToString("yyyyMMddHHmmSSfff"));
            return ApiSuccess(rs1);
        }
        //pass
        [Route("api/put/put")]
        [HttpPut]
        public IHttpActionResult DemoPut([FromBody]ConditionModel model)
        {
            return Ok(model);
        }
        //pass
        [Route("api/del/del")]
        [HttpDelete]
        public IHttpActionResult DemoDelete([FromBody]ConditionModel model)
        {
            return Ok(model);
        }

        [Route("api/del/dels")]
        [HttpDelete]
        public IHttpActionResult DemoDeletes([FromBody]ConditionModel model)
        {
            var rs = Request;
            return Ok(model);
        }

        //pass
        [Route("api/post/post")]
        [HttpPost]
        public IHttpActionResult DemoPost([FromBody]ConditionModel model)
        {
            return Ok(model);
        } 
        #endregion
    
    }

    public class ConditionModel
    {
        public int Id { get; set; }
        public string Content { get; set; }
    }
}
